<template>
  <q-layout view="lHh lpR fFf">
    <q-header style="background-color: #304156"    class="tw-text-gray-400">
      <q-toolbar>
        <q-btn dense flat round icon="menu" @click="toggleLeftDrawer"/>
        <q-toolbar-title>
          <q-breadcrumbs ref="breadcrumbs" id="breadcrumbs"  style="font-size: 15px">
            <q-breadcrumbs-el icon="home" label="选题系统后台" />
          </q-breadcrumbs>

        </q-toolbar-title>
        <q-space />

        <q-btn dense flat round icon="fullscreen" @click="fullscreen()" />
        <q-btn dense flat round icon="logout" class="tw-ml-2" @click="logout" />
        <q-avatar class="tw-ml-4">
          <img src="https://cdn.quasar.dev/img/avatar.png">
        </q-avatar>
      </q-toolbar>

    </q-header>
    <q-drawer show-if-above  style="background-color: #304156" class="text-white tw-m-auto" v-model="leftDrawerOpen" side="left" bordered>

      <q-list>
        <q-item class="text-center">
          <div class="text-h5 ">导航栏</div>
        </q-item>
        <q-item clickable to="/t/index">
          <q-item-section avatar ><q-icon  size="sm" name="home"/></q-item-section>
          <q-item-section>首页</q-item-section>
        </q-item>
        <q-item clickable to="/t/project">
          <q-item-section avatar ><q-icon  size="sm" name="star"/></q-item-section>

          <q-item-section>选题查看</q-item-section>
        </q-item>
        <q-item clickable to="/t/config">
          <q-item-section avatar ><q-icon  size="sm" name="settings"/></q-item-section>
          <q-item-section>信息维护</q-item-section>
        </q-item>
      </q-list>
    </q-drawer>

    <q-page-container>
      <router-view/>
    </q-page-container>

  </q-layout>
</template>

<script setup>

import {api} from "boot/axios";
import {ref} from 'vue'
import {useRouter} from "vue-router";

let tinfo = JSON.parse(localStorage.getItem('info'))
let router = useRouter()
let leftDrawerOpen = ref(false)
let toggleLeftDrawer = ()=>{leftDrawerOpen.value = !leftDrawerOpen.value}
let fullscreen = ()=>{document.documentElement.requestFullscreen()}
let logout = ()=>{
  router.push('/login')
  localStorage.clear()
}
api({
  url: '/job/teacher/getinfo?'+new URLSearchParams({tnum:tinfo.tnum}),
  method: 'get',
}).then(res=>{

})

</script>

<style scoped>

</style>
